Add profiler required gate#3999
Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4da2fc1bd1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| process.exit(1); | ||
| } | ||
|
|
||
| const files = await changedFiles(); |
There was a problem hiding this comment.
Wrap the Node script before using await
With the workflow invoking node <<'NODE', this top-level await is evaluated in the same script that uses require('fs'), which is not valid as a plain Node script on current runner Node versions. The job exits before any PR/path logic runs (for example with ERR_AMBIGUOUS_MODULE_SYNTAX), so making profiling-required required would fail every PR instead of only gating profiler paths; wrap the body in an async main/IIFE or make the script a proper ES module.
Useful? React with 👍 / 👎.
| } | ||
|
|
||
| async function relevantGitLabStatuses() { | ||
| const combinedStatus = await requestJson(`${apiBase}/repos/${owner}/${repo}/commits/${headSha}/status`); |
There was a problem hiding this comment.
Page through commit statuses before filtering
The combined-status API response is paginated with a default page size of 30, but this call reads only the first page before filtering for dd-gitlab/profiling tests and clippy contexts. On PR commits with more than 30 status contexts from the GitLab child pipelines and other CI, the relevant GitLab status can be on a later page, causing this gate to wait until the six-hour timeout even though the status was posted; use pagination or at least per_page=100 here as is done for files and check runs.
Useful? React with 👍 / 👎.
What
Adds a dedicated
profiling-requiredGitHub Actions job that can be referenced from a GitHub ruleset.The gate runs on every PR, but only enforces profiler-owned checks when the PR touches:
profiling/**zend_abstract_interface/**For unrelated PRs it exits successfully immediately, so the check can safely be made required without relying on path-filtered workflow behavior.
What it validates
For relevant PRs, the job polls the PR head commit until matching checks/statuses are terminal, then fails if any are red:
Profiling, usingworkflow name / job nameso matrix jobs under workflows likeProfiling correctnessare covered.dd-gitlab/clippy *.dd-gitlab/profiling tests.The gate fails closed if no GitHub Actions
Profilingchecks appear or ifdd-gitlab/profiling testsnever appears.Notes
profiling-required; add that check to the GitHub ruleset after this lands.